package com.moyq5.mvc.maker.test.web;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.realm.AuthenticatingRealm;
import org.springframework.stereotype.Component;

@Component
public class MyRealm extends AuthenticatingRealm {
	
	@Override
	protected AuthenticationInfo doGetAuthenticationInfo(
			AuthenticationToken token) throws AuthenticationException {
		return new SimpleAuthenticationInfo(token.getPrincipal(),token.getCredentials(), "") ;
	}

	@Override
	public Class<?> getAuthenticationTokenClass() {
		return AdminAuthenticationToken.class;
	}

}
